package com.chris.design.pattern.samples.adapter;

/**
 * 对象委托，包装对象Wrapper
 *
 * @author Chris
 */
public class Adapter2 {
    /**
     * 委托
     */
    Adaptee delegate;

    public Adapter2() {
    }

    public Adapter2(Adaptee delegate) {
        this.delegate = delegate;
    }

    /**
     * 源类Adaptee有方法sampleOperation1
     * 因此适配器类直接委派即可
     */
    public void sampleOper1() {
        this.delegate.sampleOper1();
        System.out.println("Adapter2=====sampleOper1===do other things");
    }

    public void sampleOper2() {
        System.out.println("Adapter2=======sampleOper2");
    }
}
